{% extends "default.html" %}

{% block content %}
<div class="title">
	Administraci&oacute;n de Vendedores
</div>
<div class="content">
	<div>Administraci&oacute;n de vendedores registrados</div>
	<table id="client_table">
		<tr>
			<th>Nombres</th>
			<th>Apellidos</th>
			<th>Usuario</th>
			<th>Acci&oacute;n</th>
		</tr>
		{% if request.vendors %}
			{% for v in request.vendors %}
				<tr>
					<td>{{ v.user.first_name }}</td>
					<td>{{ v.user.last_name }}</td>
					<td>{{ v.user.username }}</td>
					{% if request.vendor.is_owner %}
						<td><a href="/staff/vendors/delete/{{ v.id }}/">Eliminar</a></td>
					{% endif %}
				</tr>
			{% endfor %}
		{% else %}
		<tr>
			<td>No se han registrado vendedores</td>
		</tr>
		{% endif %}
	</table>
	{% if request.vendor.is_owner %}
		<div>Ingrese la siguiente informaci&oacute;n para registrar a un vendedor</div>
		<form action="/staff/vendors/register/" method="post">
			<table id="client_register">
				<tr>
					<th>Nombres</th>
					<td><input type="text" name="firstname"></td>
				</tr>
				<tr>
					<th>Apellidos</th>
					<td><input type="text" name="lastname"></td>
				</tr>
				<tr>
					<th>Usuario</th>
					<td><input type="text" name="username"></td>
				</tr>
				<tr>
					<th>Contrase&ntilde;a</th>
					<td><input type="text" name="password"></td>
				</tr>
				<tr>
					<td colspan="2">
						<input type="submit" value="Registrar">
					</td>
				</tr>
			</table>
		</form>
	{% endif %}
</div>
{% endblock %}